package com.bsj.power.common.def.entity.job;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bsj.power.common.def.vo.pls.httpVo.HttpQualityPlanVO;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author LiJiaXin
 * @version 1.0.0
 * @description QualityPlan
 * @time 2024/6/20 15:03
 */
@Data
@NoArgsConstructor
@TableName(value = "tab_quality_plan")
public class QualityPlan {

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 工单号
     */
    @TableField(value = "job_num")
    private String jobNum;

    /**
     * QC类型 1承包商QC 2维修QC 3技术支持QC
     */
    @TableField(value = "qc_type")
    private Integer qcType;

    /**
     * 任务序号
     */
    @TableField(value = "task_id")
    private Integer taskId;

    /**
     * 填写人id
     */
    @TableField(value = "signed_by")
    private String signedBy;

    /**
     * 质量点
     */
    @TableField(value = "quality_point")
    private String qualityPoint;

    /**
     * QC状态 1签点异常 2签点成功
     */
    @TableField(value = "qc_state")
    private Integer qcState;

    /**
     * 实际结果
     */
    @TableField(value = "actual_result")
    private String actualResult;

    /**
     * 见证人id
     */
    @TableField(value = "eyewitness")
    private Integer eyewitness;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    public QualityPlan(HttpQualityPlanVO httpQualityPlanVO) {
        this.jobNum = httpQualityPlanVO.getWonum();
        this.taskId = httpQualityPlanVO.getTaskid2();
        this.qualityPoint = httpQualityPlanVO.getWpm2();
        this.actualResult = httpQualityPlanVO.getWpm6();
    }

    public QualityPlan(String jobNum, Integer taskId) {
        this.jobNum = jobNum;
        this.taskId = taskId;
    }
}
